#include<bits/stdc++.h>

using namespace std;
using ll=long long;

int main() {//nlogn
    int n;
    cin >> n;
    for (int p = 1; p < n; p++) {
        ll left = p + 1, right = n - 1;
        while (left <= right) {
            ll q = (left + right) / 2;
            ll s = (q - p + 1) * (p + q) / 2;
            if (s == n) {
                cout << p << " " << q << endl;
                break;
            } else if (s > n) {
                right = q - 1;
            } else {
                left = q + 1;
            }
        }

    }

    return 0;
}
